from config.secure import Secure_info


class ConfigBase:
    CODE_SUCCESS = {'code': '2000', 'zhmsg': '成功', 'enmsg': 'Success', 'data': '应有的数据'}
    CODE_FORBIDDEN = {'code': '2002', 'zhmsg': '用户权限不足', 'enmsg': 'Forbidden', 'data': 'None'}
    CODE_UNAUTHORIZED = {'code': '2003', 'zhmsg': '未认证的用户', 'enmsg': 'Unauthorized', 'data': 'None'}
    CODE_REPEATLOGINNAME = {'code': '2004', 'zhmsg': '登录名已被占用', 'enmsg': 'RepeatLoginname', 'data': 'None'}
    CODE_REQUESTTYPEERROR = {'code': '4001', 'zhmsg': '请求参数类型错误', 'enmsg': 'RequestTypeError', 'data': 'None'}
    CODE_MISSINGPARAMETERS = {'code': '4002', 'zhmsg': '缺少必要的参数', 'enmsg': 'MissingParameters', 'data': 'None'}
    CODE_UPLOADDATAERROR = {'code': '4003', 'zhmsg': '上传的数据有误', 'enmsg': 'UploadDataError', 'data': 'None'}
    CODE_APIWILLABORT = {'code': '5000', 'zhmsg': '请求成功，但是该api即将停止服务', 'enmsg': 'ApiWillAbort', 'data': 'None'}
    CODE_DATAANALYZEUNKNOWNERROR = {'code': '5001', 'zhmsg': '分析内容出错，原因未知', 'enmsg': 'DataAnalyzeUnknownError',
                                    'data': 'Expection'}
    CODE_APIABORT = {'code': '5005', 'zhmsg': 'api已经停止使用', 'enmsg': 'ApiAbort', 'data': 'None'}
    CODE_DOWNLOADERROR = {'code': '5006', 'zhmsg': '下载失败', 'enmsg': 'DownloadError', 'data': 'None'}
    CODE_UNKNOWNERROR = {'code': '6001', 'zhmsg': '请求失败,原因未知', 'enmsg': 'UnknownError', 'data': 'None'}

    SERVERHOST = '127.0.0.1:5000'

    SECRET_KEY = 'HARD TO Guess'

    MAIL_SERVER = 'smtp.163.com'
    MAIL_PORT = 25
    MAIL_USE_SSL = False
    MAIL_USERNAME = Secure_info.get_mail_user()
    MAIL_PASSWORD = Secure_info.get_mail_passwd()
    MAIL_DEFAULT_SENDER = Secure_info.get_mail_user()

    SECURITY_EMAIL_SENDER = 'xminer_assistant@163.com'
    SECURITY_PASSWORD_SALT = 'haha'
    SECURITY_REGISTERABLE = True
    SECURITY_REGISTER_URL = '/register'
    SECURITY_RECOVERABLE = True
    SECURITY_TRACKABLE = True
    SECURITY_CONFIRMABLE = True
    SECURITY_SEND_REGISTER_EMAIL = True
    SECURITY_USER_IDENTITY_ATTRIBUTES = ['email', 'loginame']


